<template>
  <CommonHeaderComponent class="draft_div">
    <div slot="headTopContent">
      <a-tabs v-model="activtKey">
        <a-tab-pane key="1">
          <div slot="tab">
            {{ `行政复议 ${ admreiveDealNum? "（" + admreiveDealNum + "）" : "（0）"}` }}
          </div>
        </a-tab-pane>
        <a-tab-pane key="2">
          <div slot="tab">
            {{ `复议监督 ${ superviseDealNum? "（" + superviseDealNum + "）" : "（0）"}` }}
          </div>
        </a-tab-pane>
      </a-tabs>
    </div>

    <template slot="headContent">
      <div v-show="activtKey == '1'">
        <AppeptExamineCommonDraft ref="AppeptExamineCommonDraftRef" @setTotal="setAdmrevieTotal"></AppeptExamineCommonDraft>
      </div>
      <div v-show="activtKey == '2'">
        <SuperviseDraft ref="SuperviseDraftRef" @setTotal="setSuperviseTotal"></SuperviseDraft>
      </div>
    </template>
  </CommonHeaderComponent>
</template>

<script>
  import CommonHeadQueryComponent from '@/views/accept/component/CommonHeadQueryComponent.vue'
  import CommonHeaderComponent from '@/views/accept/component/CommonHeaderComponent.vue'
  export default {
    data () {
      return {
        admreiveDealNum: null,
        superviseDealNum: null,
        activtKey: '1'
      }
    },
    components: {
      CommonHeadQueryComponent,
      CommonHeaderComponent,
      SuperviseDraft: () => import('@/views/supervise/SuperviseDraft.vue'),
      AppeptExamineCommonDraft: () => import('@/views/accept/examine/AppeptExamineCommonDraft.vue')
    },
    created () {
      if(localStorage.getItem('AppeptExamineCommonDraftUrl')){
        this.activtKey = 1
        console.log('sss',this.activtKey);

      }else if(localStorage.getItem('SuperviseDraftUrl')){
        this.activtKey = 2
        console.log('zzz',this.activtKey);
      }
      localStorage.removeItem('AppeptExamineCommonDraftUrl')
      localStorage.removeItem('SuperviseDraftUrl')

      this.$nextTick(() => {
        if (this.$refs.AppeptExamineCommonDraftRef) {
          this.$refs.AppeptExamineCommonDraftRef.queryList()
        }
        if (this.$refs.SuperviseDraftRef) {
          this.$refs.SuperviseDraftRef.queryList()
        }
      })
    },
    mounted () {
    },
    methods: {
      setAdmrevieTotal (num) {
        this.admreiveDealNum = num
      },
      setSuperviseTotal (num) {
        this.superviseDealNum = num
      }
    }
  }
</script>

<style lang="less" scoped>
.cursor_pointer:hover {
  color: #55a7f5;
}
::v-deep .ant-tabs-tab:hover {
  color: inherit !important;
}
::v-deep .ant-tabs-nav-scroll {
  margin-left: 20px;
}
::v-deep .accept_main_tip_label_div {
  width: 300px !important;
}
::v-deep .ant-form-item-label {
  margin: 0px 8px;
}
::v-deep .ant-tabs-bar {
  margin-bottom: 0px;
}
::v-deep .ant-tabs-nav .ant-tabs-tab {
  font-family: PingFang SC;
  font-weight: 500;
  font-size: 16px;
  margin: 0 16px 10px 0;
  line-height: 0px;
}
::v-deep .ant-tabs-nav-scroll {
  background: white;
  padding-left: 10px;
  margin-left: 0px;
}
.draft_div {
  ::v-deep .ant-tabs-ink-bar {
    margin: 0px 10%;
    width: 50px !important;
  }
}
::v-deep .ant-tabs-nav-wrap {
  display: inherit;
}
</style>
